package com.core.reach.cloudhub.controller;

import com.core.reach.cloudhub.domain.Payment;
import lombok.extern.slf4j.Slf4j;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.RestController;
import org.springframework.web.client.RestTemplate;

import javax.annotation.Resource;

/**
 * @author ga.zhang
 * @version V1.0
 * @description: TODO
 * @date 2020/3/24 14:25
 **/
@Slf4j
@RestController
public class OrderZkController {

    @Resource
    private RestTemplate restTemplate;

    private final static String PAYMENT_URL = "http://cloud-payment-service";

    @GetMapping("/consumer/zk")
    public String create(Payment payment) {
        return restTemplate.getForObject(PAYMENT_URL + "/payment/zk", String.class);
    }

}
